<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html>
<head>
    <link href="css/bootstrap.min.css" rel="stylesheet" />

</head>
<body>

<div style="margin: 50px 50px">
    <input id="product_search" type="text" data-provide="typeahead">
</div>

<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
<%--<script type="text/javascript" src="js/layer/layer.js"></script>--%>
<script>
    $(document).ready(function($) {
       varjudge=[];
        // Workaround for bug in mouse item selection
        $.fn.typeahead.Constructor.prototype.blur = function() {
            var that = this;
            setTimeout(function () { that.hide() }, 250);
        };
        /*$.ajax({
            type:"GET",
            url:"plan/selectJudge?t=" + Math.random(),
            dataType : "json",
            success: function(result) {
                judge = result;
                alert(judge);
                return result;
            },
            error: function(e){
                layer.closeAll('loading');
                layer.msg("请求服务器异常！");
            }
        });*/
       // $.get("plan/selectJudge?t="+Math.random(),success(result),"json");
        $('#product_search').typeahead({
            source: function(query, process) {
                return judge;
            }
        });
    })

</script>
</body>
</html>